function queryAdd(val,k,isNotRN){
    return k + (val || '') + (isNotRN ?'':'\r\n')
}
function setAttr(name,config,isNotString){
    return window.$validatenull(config[name]) ? '' : `${isNotString?':':''}${name}="${config[name]}" `
}
function setAttrArray(name,config){
    let data = JSON.stringify(config[name]).replace(/"/g,"'")
    return window.$validatenull(config[name]) ? '' : `:${name}="${data}" `
}

const components ={
    input:{
        query(config,queryProp,k){
            return queryAdd(`<el-input v-model="queryData.${queryProp}" :placeholder="$t('请输入')" />`,k,true)
        },
        form(config,prop,k){
            let res = ''
            res += '<el-input'
            res += ` :disabled="!lr_formEditAuth('${prop}')" `
            // 前图标
            res += setAttr('prefixIcon',config)
            // 后图标
            res += setAttr('suffixIcon',config)
            // 最大长度
            res += setAttr('maxlength',config,true)
            // 是否只读
            res += setAttr('readonly',config,true)

            res += `v-model="formData.${prop}" :placeholder="$t('${config.placeholder}')" >`

            if(config.prepend){
                res +='\r\n'+ k + `    <template #prepend >\r\n`
                res += k + `        ${config.prepend}\r\n`
                res += k + `    </template>`
            }

            if(config.append){
                res +='\r\n'+ k + `    <template #append >\r\n`
                res += k + `        ${config.append}\r\n`
                res += k + `    </template>`
            }
            
            res = queryAdd(res,k)
            res += queryAdd(`</el-input>`,k,true)
            return res
        },
        table(config,prop,k,table){
            let res = ''
            res += '<el-input size="mini" '
            
            res += ` :disabled="!lr_formTableEditAuth('${table}','${prop}')" `

            // 前图标
            res += setAttr('prefixIcon',config)
            // 后图标
            res += setAttr('suffixIcon',config)
            // 最大长度
            res += setAttr('maxlength',config,true)
            // 是否只读
            res += setAttr('readonly',config,true)

            res += `v-model="scope.row.${prop}" :placeholder="$t('${config.placeholder}')" >`

            if(config.prepend){
                res +='\r\n'+ k + `    <template #prepend >\r\n`
                res += k + `        ${config.prepend}\r\n`
                res += k + `    </template>`
            }

            if(config.append){
                res +='\r\n'+ k + `    <template #append >\r\n`
                res += k + `        ${config.append}\r\n`
                res += k + `    </template>`
            }
            
            res = queryAdd(res,k)
            res += queryAdd(`</el-input>`,k,true)
            return res
        }
    },
    textarea:{
        query(config,queryProp,k){
            return queryAdd(`<el-input v-model="queryData.${queryProp}" :placeholder="$t('请输入')"/>`,k,true)
        },
        form(config,prop,k){
            let res = ''
            res += '<el-input type="textarea" '
            res += ` :disabled="!lr_formEditAuth('${prop}')" `
            // 行数
            res += setAttr('rows',config,true)
            // 最大长度
            res += setAttr('maxlength',config,true)
            // 显示计数
            res += setAttr('showWordLimit',config,true)

            res += `v-model="formData.${prop}" :placeholder="$t('${config.placeholder}')" />`
            
            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-input>`,k,true)
            return res
        },
        table(config,prop,k,table){
            let res = ''
            res += '<el-input size="mini" type="textarea" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${prop}')" `

            // 行数
            res += setAttr('rows',config,true)
            // 最大长度
            res += setAttr('maxlength',config,true)
            // 显示计数
            res += setAttr('showWordLimit',config,true)

            res += `v-model="scope.row.${prop}" :placeholder="$t('${config.placeholder}')" />`
            
            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-input>`,k,true)
            return res
        }
    },
    password:{
        form(config,prop,k){
            let res = ''
            res += '<el-input type="password" '
            res += ` :disabled="!lr_formEditAuth('${prop}')" `
            // 前图标
            res += setAttr('prefixIcon',config)
            // 后图标
            res += setAttr('suffixIcon',config)
            // 最大长度
            res += setAttr('maxlength',config,true)
            // 是否只读
            res += setAttr('readonly',config,true)

            res += `v-model="formData.${prop}" :placeholder="$t('${config.placeholder}')" >`

            if(config.prepend){
                res +='\r\n'+ k + `    <template #prepend >\r\n`
                res += k + `        ${config.prepend}\r\n`
                res += k + `    </template>`
            }

            if(config.append){
                res +='\r\n'+ k + `    <template #append >\r\n`
                res += k + `        ${config.append}\r\n`
                res += k + `    </template>`
            }
            
            res = queryAdd(res,k)
            res += queryAdd(`</el-input>`,k,true)
            return res
        },
        table(config,prop,k,table){
            let res = ''
            res += '<el-input size="mini" type="password" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${prop}')" `

            // 前图标
            res += setAttr('prefixIcon',config)
            // 后图标
            res += setAttr('suffixIcon',config)
            // 最大长度
            res += setAttr('maxlength',config,true)
            // 是否只读
            res += setAttr('readonly',config,true)

            res += `v-model="scope.row.${prop}" :placeholder="$t('${config.placeholder}')" >`

            if(config.prepend){
                res +='\r\n'+ k + `    <template #prepend >\r\n`
                res += k + `        ${config.prepend}\r\n`
                res += k + `    </template>`
            }

            if(config.append){
                res +='\r\n'+ k + `    <template #append >\r\n`
                res += k + `        ${config.append}\r\n`
                res += k + `    </template>`
            }
            
            res = queryAdd(res,k)
            res += queryAdd(`</el-input>`,k,true)
            return res
        }
    },
    texteditor:{
        query(config,queryProp,k){
            return queryAdd(`<el-input v-model="queryData.${queryProp}" :placeholder="$t('请输入')" />`,k,true)
        },
        form(config,prop,k){
            return queryAdd(`<l-editor :disabled="!lr_formEditAuth('${prop}')" v-model="formData.${prop}" :options="{ theme:'snow',placeholder: $t('请输入内容...')}"  />`,k,true)
        }
    },
    number:{
        query(config,queryProp,k){
            let res = ''
            res += '<el-input-number '
            // 最小值
            res += setAttr('min',config,true)
            // 最大值
            res += setAttr('max',config,true)
            // 精度
            res += setAttr('precision',config,true)
            // 步长
            res += setAttr('step',config,true)
            // 步长倍数
            res += setAttr('stepStrictly',config,true)
            // 步长倍数
            res += setAttr('stepStrictly',config,true)
            // 按钮位置
            res += setAttr('controlsPosition',config) 

            res += `v-model="queryData.${queryProp}" :placeholder="$t('请输入')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-input-number>`,k,true)
            return res
        },
        form(config,queryProp,k){
            let res = ''
            res += '<el-input-number '
            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `
            // 最小值
            res += setAttr('min',config,true)
            // 最大值
            res += setAttr('max',config,true)
            // 精度
            res += setAttr('precision',config,true)
            // 步长
            res += setAttr('step',config,true)
            // 步长倍数
            res += setAttr('stepStrictly',config,true)
            // 步长倍数
            res += setAttr('stepStrictly',config,true)
            // 按钮位置
            res += setAttr('controlsPosition',config) 

            res += `v-model="formData.${queryProp}" :placeholder="$t('请输入')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-input-number>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            let res = ''
            res += '<el-input-number  size="mini" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 最小值
            res += setAttr('min',config,true)
            // 最大值
            res += setAttr('max',config,true)
            // 精度
            res += setAttr('precision',config,true)
            // 步长
            res += setAttr('step',config,true)
            // 步长倍数
            res += setAttr('stepStrictly',config,true)
            // 步长倍数
            res += setAttr('stepStrictly',config,true)
            // 按钮位置
            res += setAttr('controlsPosition',config) 

            res += `v-model="scope.row.${queryProp}" :placeholder="$t('请输入')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-input-number>`,k,true)
            return res
        }
    },
    radio:{
        query(config,queryProp,k){
            return queryAdd(`<l-select :options="${queryProp}Options" v-model="queryData.${queryProp}" />`,k,true)
            //return queryAdd(`<l-radio :options="${queryProp}Options" v-model="queryData.${queryProp}" ></l-radio>`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            console.log(isUpCtrls,'isUpCtrls')
            return queryAdd(`<l-radio :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} :options="${queryProp}Options" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-radio  :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} :options="${window.$lowerFirst(table)}_${queryProp}Options" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    checkbox:{
        query(config,queryProp,k){
            return queryAdd(`<l-select :multiple="true" :options="${queryProp}Options" v-model="queryData.${queryProp}" />`,k,true)
            //return queryAdd(`<l-checkbox :options="${queryProp}Options" v-model="queryData.${queryProp}" ></l-checkbox>`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-checkbox :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} :options="${queryProp}Options" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-checkbox :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} :options="${window.$lowerFirst(table)}_${queryProp}Options" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    select:{
        query(config,queryProp,k){
            return queryAdd(`<l-select :options="${queryProp}Options" v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-select :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} :options="${queryProp}Options" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-select :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} size="mini" :options="${window.$lowerFirst(table)}_${queryProp}Options" v-model="scope.row.${queryProp}" />`,k,true)
        },
    },
    selectMultiple:{
        query(config,queryProp,k){
            return queryAdd(`<l-select :multiple="true" :options="${queryProp}Options" v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-select :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} :multiple="true" :options="${queryProp}Options" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-select :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" size="mini" :multiple="true" ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} :options="${window.$lowerFirst(table)}_${queryProp}Options" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    treeselect:{
        query(config,queryProp,k){
            return queryAdd(`<l-tree-select :options="${queryProp}Options" v-model="queryData.${queryProp}" />`,k,true)
            
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-tree-select :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} :options="${queryProp}Options" v-model="formData.${queryProp}" />`,k,true) 
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-tree-select :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} size="mini" :options="${window.$lowerFirst(table)}_${queryProp}Options" v-model="scope.row.${queryProp}" />`,k,true) 
        }
    },
    layerselect:{
        query(config,queryProp,k){
            return queryAdd(`<l-layer-select 
                            v-model="queryData.${queryProp}" 
                            :isPage="${config.isPage}"
                            :height="${config.height}"
                            :width="${config.width}"
                            :columns="${JSON.stringify(config.columns).replace(/"/g,"'")}"
                            :options="${queryProp}Options"

                           />`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-layer-select 
                                          :disabled="!lr_formEditAuth('${queryProp}')" 
                                          :isPage="${config.isPage}"
                                          :height="${config.height}"
                                          :width="${config.width}"
                                          :columns="${JSON.stringify(config.columns).replace(/"/g,"'")}"
                                          :options="${queryProp}Options" 
                                          v-model="formData.${queryProp}"
                                          ${isUpCtrls?`@change="${queryProp}_change"`:''}
                                       />`,k,true) 
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-layer-select 
                                              :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" 
                                              :isPage="${config.isPage}"
                                              :height="${config.height}"
                                              :width="${config.width}"
                                              :columns="${JSON.stringify(config.columns).replace(/"/g,"'")}"
                                              :options="${window.$lowerFirst(table)}_${queryProp}Options" 
                                              v-model="scope.row.${queryProp}"
                                              ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''}
                                            />`,k,true) 
        }
    },
    time:{
        query(config,queryProp,k){
            let res = ''
            res += '<l-time isRange '
            // 时间格式
            res += setAttr('format',config)
            // 时间范围
            res += setAttr('selectableRange',config)
            res += `v-model="queryData.${queryProp}" :placeholder="$t('请选择')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-time>`,k,true)
            return res
        },
        form(config,queryProp,k){
            let res = ''
            res += '<l-time  '
            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `
            // 时间格式
            res += setAttr('format',config)
            // 时间范围
            res += setAttr('selectableRange',config)
            // 是否清空
            res += setAttr('clearable',config,true)
            
            res += `v-model="formData.${queryProp}" :placeholder="$t('请选择')" />`


            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-time>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            let res = ''
            res += '<l-time size="mini" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 时间格式
            res += setAttr('format',config)
            // 时间范围
            res += setAttr('selectableRange',config)
            // 是否清空
            res += setAttr('clearable',config,true)
            
            res += `v-model="scope.row.${queryProp}" :placeholder="$t('请选择')" />`


            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-time>`,k,true)
            return res
        },
    },
    timerange:{
        form(config,queryProp,k){
            let res = ''
            res += '<l-time isRange '

            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `

            // 时间格式
            res += setAttr('format',config)
            // 是否清空
            res += setAttr('clearable',config,true)
            
            res += `v-model="formData.${queryProp}" :startPlaceholder="$t('${config.startPlaceholder}')" :endPlaceholder="$t('${config.endPlaceholder}')" />`
            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-time>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            let res = ''
            res += '<l-time size="mini" isRange '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 时间格式
            res += setAttr('format',config)
            // 是否清空
            res += setAttr('clearable',config,true)
            
            res += `v-model="scope.row.${queryProp}" :startPlaceholder="$t('${config.startPlaceholder}')" :endPlaceholder="$t('${config.endPlaceholder}')" />`


            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-time>`,k,true)
            return res
        }
    },
    datetime:{
        query(config,queryProp,k){
            
            let res = ''
            res += '<l-date '
            // 时间格式
            res += setAttr('format',config)
            // 时间类型
            if(config.dateType != 'year'){
                res += ` dateType="${config.dateType}range" `
            }
            else{
                res += setAttr('dateType',config)
            }
            res += `v-model="queryData.${queryProp}" :placeholder="$t('请选择')" />`
            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-date>`,k,true)
            return res
        },
        form(config,queryProp,k){
            
            let res = ''
            res += '<l-date '

            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `

            // 时间格式
            res += setAttr('format',config)
            // 时间类型
            res += setAttr('dateType',config)
            // 是否清空
            res += setAttr('clearable',config,true)

            res += `v-model="formData.${queryProp}" :placeholder="$t('请选择')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-date>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            
            let res = ''
            res += '<l-date size="mini" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 时间格式
            res += setAttr('format',config)
            // 时间类型
            res += setAttr('dateType',config)
            // 是否清空
            res += setAttr('clearable',config,true)

            res += `v-model="scope.row.${queryProp}" :placeholder="$t('请选择')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-date>`,k,true)
            return res
        },
    },
    datetimerange:{
        form(config,queryProp,k){
            
            let res = ''
            res += '<l-date '

            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `

            // 时间格式
            res += setAttr('format',config)
            // 时间类型
            res += setAttr('dateType',config)
            // 是否清空
            res += setAttr('clearable',config,true)

            res += `v-model="formData.${queryProp}" :startPlaceholder="$t('${config.startPlaceholder}')" :endPlaceholder="$t('${config.endPlaceholder}')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-date>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            
            let res = ''
            res += '<l-date size="mini" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 时间格式
            res += setAttr('format',config)
            // 时间类型
            res += setAttr('dateType',config)
            // 是否清空
            res += setAttr('clearable',config,true)

            res += `v-model="scope.row.${queryProp}" :startPlaceholder="$t('${config.startPlaceholder}')" :endPlaceholder="$t('${config.endPlaceholder}')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-date>`,k,true)
            return res
        },
    },
    modifytime:{
        query(config,queryProp,k){
            let res = ''
            res += '<l-date '
            res += ` dateType="datetimerange" `
            res += `v-model="queryData.${queryProp}" :placeholder="$t('请选择')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-date>`,k,true)
            return res
        },
        form(config,queryProp,k){
            return queryAdd(`<l-modifytime v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-modifytime size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    createtime:{
        query(config,queryProp,k){
            
            let res = ''
            res += '<l-date '
            res += ` dateType="datetimerange" `
            res += `v-model="queryData.${queryProp}" :placeholder="$t('请选择')" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</l-date>`,k,true)
            return res
        },
        form(config,queryProp,k){
            return queryAdd(`<l-createtime v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-createtime size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    companySelect:{
        query(config,queryProp,k){
            return queryAdd(`<l-company-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-company-select :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-company-select :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        },
    },
    company:{
        query(config,queryProp,k){
            return queryAdd(`<l-company-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-company v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-company size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    
    departmentSelect:{
        query(config,queryProp,k){
            return queryAdd(`<l-department-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-department-select :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-department-select :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    department:{
        query(config,queryProp,k){
            return queryAdd(`<l-department-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-department v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-department size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    userSelect:{
        query(config,queryProp,k){
            return queryAdd(`<l-user-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k,isUpCtrls){
            return queryAdd(`<l-user-select :disabled="!lr_formEditAuth('${queryProp}')" ${isUpCtrls?`@change="${queryProp}_change"`:''} v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table,isUpCtrls){
            return queryAdd(`<l-user-select :disabled="!lr_formTableEditAuth('${table}','${queryProp}')"  ${isUpCtrls?`@change="${queryProp}_change(scope.rows)"`:''} size="mini"  v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    createuser:{
        query(config,queryProp,k){
            return queryAdd(`<l-user-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-createuser v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-createuser size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    modifyuser:{
        query(config,queryProp,k){
            return queryAdd(`<l-user-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-createtime  v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-createtime size="mini"  v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    icon:{
        query(config,queryProp,k){
            return queryAdd(`<l-input-icon v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-input-icon :disabled="!lr_formEditAuth('${queryProp}')" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table){
            return queryAdd(`<l-input-icon :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        }
    },
    rate:{
        query(config,queryProp,k){
            let res = ''
            res += '<el-rate '
            // 最大分值
            res += setAttr('max',config,true)
            // 低分段
            res += setAttr('lowThreshold',config,true)
            // 高分段
            res += setAttr('highThreshold',config,true)
            // 未选择颜色
            res += setAttr('voidColor',config)
            // 只读颜色
            res += setAttr('disabledVoidColor',config)
            // 文字颜色
            res += setAttr('textColor',config)
            // 未选择图标
            res += setAttr('voidIconClass',config)
            // 只读图标
            res += setAttr('disabledVoidIconClass',config)
            // 允许半选
            res += setAttr('allowHalf',config,true)
            // 显示文字
            res += setAttr('showText',config,true)
            // 显示分数
            res += setAttr('showScore',config,true)
            // 颜色组
            res += setAttrArray('colors',config)
            // 图标组
            res += setAttrArray('iconClasses',config)
            // 文字组
            res += setAttrArray('texts',config)

            res += `v-model="queryData.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-rate>`,k,true)
            return res
        },
        form(config,queryProp,k){
            let res = ''
            res += '<el-rate '
            
            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `

            // 最大分值
            res += setAttr('max',config,true)
            // 低分段
            res += setAttr('lowThreshold',config,true)
            // 高分段
            res += setAttr('highThreshold',config,true)
            // 未选择颜色
            res += setAttr('voidColor',config)
            // 只读颜色
            res += setAttr('disabledVoidColor',config)
            // 文字颜色
            res += setAttr('textColor',config)
            // 未选择图标
            res += setAttr('voidIconClass',config)
            // 只读图标
            res += setAttr('disabledVoidIconClass',config)
            // 允许半选
            res += setAttr('allowHalf',config,true)
            // 显示文字
            res += setAttr('showText',config,true)
            // 显示分数
            res += setAttr('showScore',config,true)
            // 颜色组
            res += setAttrArray('colors',config)
            // 图标组
            res += setAttrArray('iconClasses',config)
            // 文字组
            res += setAttrArray('texts',config)

            res += `v-model="formData.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-rate>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            let res = ''
            res += '<el-rate size="mini" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 最大分值
            res += setAttr('max',config,true)
            // 低分段
            res += setAttr('lowThreshold',config,true)
            // 高分段
            res += setAttr('highThreshold',config,true)
            // 未选择颜色
            res += setAttr('voidColor',config)
            // 只读颜色
            res += setAttr('disabledVoidColor',config)
            // 文字颜色
            res += setAttr('textColor',config)
            // 未选择图标
            res += setAttr('voidIconClass',config)
            // 只读图标
            res += setAttr('disabledVoidIconClass',config)
            // 允许半选
            res += setAttr('allowHalf',config,true)
            // 显示文字
            res += setAttr('showText',config,true)
            // 显示分数
            res += setAttr('showScore',config,true)
            // 颜色组
            res += setAttrArray('colors',config)
            // 图标组
            res += setAttrArray('iconClasses',config)
            // 文字组
            res += setAttrArray('texts',config)

            res += `v-model="scope.row.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-rate>`,k,true)
            return res
        },
    },
    switch:{
        query(config,queryProp,k){
            let res = ''
            res += '<el-switch '
            
            // 打开值
            res += setAttr('activeValue',config,config.activeValueType != 'string')
            // 关闭值
            res += setAttr('inactiveValue',config,config.inactiveValueType != 'string')

            res += `v-model="queryData.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-switch>`,k,true)
            return res
        },
        form(config,queryProp,k){
            let res = ''
            res += '<el-switch '

            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `

            // 打开值
            res += setAttr('activeValue',config,config.activeValueType != 'string')
            // 关闭值
            res += setAttr('inactiveValue',config,config.inactiveValueType != 'string')

            res += `v-model="formData.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-switch>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            let res = ''
            res += '<el-switch size="mini" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 打开值
            res += setAttr('activeValue',config,config.activeValueType != 'string')
            // 关闭值
            res += setAttr('inactiveValue',config,config.inactiveValueType != 'string')

            res += `v-model="scope.row.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-switch>`,k,true)
            return res
        }
    },
    slider:{
        query(config,queryProp,k){
            let res = ''
            res += '<el-slider '
            // 最小值
            res += setAttr('min',config,true)
            // 最大值
            res += setAttr('max',config,true)
            // 步长
            res += setAttr('step',config,true)
            // 显示间断点
            res += setAttr('showStops',config,true)
            // 输入框
            res += setAttr('showInput',config,true)
            // 输入框按钮
            res += setAttr('showInputControls',config,true)
            // 显示Tooltip
            res += setAttr('showTooltip',config,true)

            
            
            res += `v-model="queryData.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-slider>`,k,true)
            return res
        },
        form(config,queryProp,k){
            let res = ''
            res += '<el-slider '

            res += ` :disabled="!lr_formEditAuth('${queryProp}')" `

            // 最小值
            res += setAttr('min',config,true)
            // 最大值
            res += setAttr('max',config,true)
            // 步长
            res += setAttr('step',config,true)
            // 显示间断点
            res += setAttr('showStops',config,true)
            // 输入框
            res += setAttr('showInput',config,true)
            // 输入框按钮
            res += setAttr('showInputControls',config,true)
            // 显示Tooltip
            res += setAttr('showTooltip',config,true)

            
            
            res += `v-model="formData.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-slider>`,k,true)
            return res
        },
        table(config,queryProp,k,table){
            let res = ''
            res += '<el-slider size="mini" '

            res += ` :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" `

            // 最小值
            res += setAttr('min',config,true)
            // 最大值
            res += setAttr('max',config,true)
            // 步长
            res += setAttr('step',config,true)
            // 显示间断点
            res += setAttr('showStops',config,true)
            // 输入框
            res += setAttr('showInput',config,true)
            // 输入框按钮
            res += setAttr('showInputControls',config,true)
            // 显示Tooltip
            res += setAttr('showTooltip',config,true)

            res += `v-model="scope.row.${queryProp}" />`

            res = queryAdd(res,k,true)
            //res += queryAdd(`</el-slider>`,k,true)
            return res
        },
    },
    color:{
        query(config,queryProp,k){
            return queryAdd(`<l-input-color v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-input-color :disabled="!lr_formEditAuth('${queryProp}')" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k,table){
            return queryAdd(`<l-input-color :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        },
    },
    encode:{
        query(config,queryProp,k){
            return queryAdd(`<el-input v-model="queryData.${queryProp}" :placeholder="$t('请输入')" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-code size="mini" code="${config.code}" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-code size="mini" code="${config.code}" v-model="scope.row.${queryProp}" />`,k,true)
        },
    },
    upload:{
        form(config,queryProp,k){
            return queryAdd(`<l-upload :disabled="!lr_formEditAuth('${queryProp}')" v-model="formData.${queryProp}" :placeholder="$t('请输入')" />`,k,true)
        },
        table(config,queryProp,k,table){
            return queryAdd(`<l-upload :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" v-model="scope.row.${queryProp}" :placeholder="$t('请输入')" />`,k,true)
        }
    },
    uploadimg:{
        form(config,queryProp,k){
            return queryAdd(`<l-upload :disabled="!lr_formEditAuth('${queryProp}')" v-model="formData.${queryProp}" listType="picture-card" :placeholder="$t('请输入')" />`,k,true)
        },
        table(config,queryProp,k,table){
            return queryAdd(`<l-upload :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" v-model="scope.row.${queryProp}" listType="picture-card" :placeholder="$t('请输入')" />`,k,true)
        },
    },
    areaselect:{
        query(config,queryProp,k){
            return queryAdd(`<l-area-select v-model="queryData.${queryProp}" />`,k,true)
        },
        form(config,queryProp,k){
            return queryAdd(`<l-area-select :disabled="!lr_formEditAuth('${queryProp}')" v-model="formData.${queryProp}" :placeholder="$t('${config.placeholder}')" />`,k,true)
        },
        table(config,queryProp,k,table){
            return queryAdd(`<l-area-select :disabled="!lr_formTableEditAuth('${table}','${queryProp}')" v-model="scope.row.${queryProp}" :placeholder="$t('${config.placeholder}')" />`,k,true)
        },
    },
    guid:{
        form(config,queryProp,k){
            return queryAdd(`<l-guid size="mini" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-guid size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        },
    },
    layerbmap:{
        form(config,queryProp,k){
            return queryAdd(`<l-BMap-select :height="${config.height}" :width="${config.width}" size="mini" v-model="formData.${queryProp}" />`,k,true)
        },
        table(config,queryProp,k){
            return queryAdd(`<l-BMap-select :height="${config.height}" :width="${config.width}" size="mini" v-model="scope.row.${queryProp}" />`,k,true)
        },
    }

}

/**
 * k 空格数
 */
export const getQueryComponents = (config,queryProp,k)=>{
    let res = '';
    let component = components[config.type]

    if(component && component.query){
        res = component.query(config,queryProp,k)
    }

    return res;
}


/**
 * k 空格数
 */
export const getFormComponents = (config,queryProp,k,isUpCtrls)=>{
    let res = '';
    let component = components[config.type]

    if(component && component.form){
        res = component.form(config,queryProp,k,isUpCtrls)
    }

    return res;
}

/**
 * k 空格数
 */
 export const getTableComponents = (config,queryProp,k,table,isUpCtrls)=>{
    let res = '';
    let component = components[config.type]

    if(component && component.table){
        res = component.table(config,queryProp,k,table,isUpCtrls)
    }

    return res;
}